package com.swak.devtools.test.api;

import java.util.List;

import com.swak.annotation.ApiDoc;
import com.swak.annotation.Get;
import com.swak.annotation.RestApi;
import com.swak.entity.Result;
import com.swak.utils.Lists;

/**
 * 测试的APi
 * 
 * @author 618lf
 */
@RestApi(path = "/api/order", value = "OrderApi")
public class OrderApi extends BaseApi<OrderBookRespDTO> {

//	@ApiDoc(module = "订单管理", function = "订单下单", describe = "用户选择商品下单!")
//	@Get("/book")
//	public Result<OrderBookRespDTO> book(OrderBookReqDTO order, List<OrderBookReqDTO> reqs,
//			Map<String, OrderBookReqDTO> maps) {
//		return Result.success(new OrderBookRespDTO());
//	}

//	@ApiDoc(module = "订单管理", function = "订单异步下单", describe = "用户选择商品下单!")
//	@Get("/book/async")
//	public CompletableFuture<Result<OrderBookRespDTO>> asyncBook(OrderBookReqDTO order) {
//		return CompletableFuture.completedFuture(Result.success(new OrderBookRespDTO()));
//	}
//
	@ApiDoc(module = "订单管理", function = "订单列表", describe = "查询用户的订单列表")
	@Get("/orders")
	public Result<List<OrderBookRespDTO>> list1(OrderBookReqDTO order) {
		List<OrderBookRespDTO> orders = Lists.newArrayList();
		return Result.success(orders);
	}
//
//	@ApiDoc(module = "订单管理", function = "订单列表", describe = "查询用户的订单列表")
//	@Get("/orders")
//	public Result<Set<OrderBookRespDTO>> list2(OrderBookReqDTO order) {
//		Set<OrderBookRespDTO> orders = Sets.newHashSet();
//		return Result.success(orders);
//	}
//
//	@ApiDoc(module = "订单管理", function = "订单列表", describe = "查询用户的订单列表")
//	@Get("/orders")
//	public Result<OrderBookRespDTO[]> list3(OrderBookReqDTO order) {
//		OrderBookRespDTO[] orders = new OrderBookRespDTO[10];
//		return Result.success(orders);
//	}
//
//	@ApiDoc(module = "订单管理", function = "订单列表", describe = "查询用户的订单列表")
//	@Get("/orders")
//	public CompletableFuture<Result<List<OrderBookRespDTO>>> list4(OrderBookReqDTO order) {
//		List<OrderBookRespDTO> orders = Lists.newArrayList();
//		return CompletableFuture.completedFuture(Result.success(orders));
//	}

//	/**
//	 * 不支持 Map，这是不友好的Api;
//	 * 
//	 * @param order
//	 * @return
//	 */
//	@ApiDoc(module = "订单管理", function = "订单列表", describe = "查询用户的订单列表")
//	@Get("/orders")
//	public Result<Map<String, OrderBookRespDTO>> list3(OrderBookReqDTO order) {
//		Map<String, OrderBookRespDTO> orders = Maps.newHashMap();
//		return Result.success(orders);
//	}
}